package com.miracle9.game.dao;
import com.miracle9.game.bean.Pager;
import com.miracle9.game.entity.PromoterLog;
import com.miracle9.game.util.MyUtil;
import org.hibernate.Session;
import org.springframework.stereotype.Repository;

@Repository
public class PromoterLogServiceDao extends SqlOperating<PromoterLog, Integer>
{
  public Pager getPagerByInterval(int promoterId, String date, Pager pager)
  {
    String dateFrom = date + " 00:00:00";
    String dateTo = date + " 23:59:59";
    return q_CreateSqlsPager("from promoterLog where promoterId = ? and datetime>=? and datetime<=?", pager, new Object[] { Integer.valueOf(promoterId), 
      dateFrom, dateTo });
  }
  
  public void save_3(int promoterId, String content, String contentEn)
  {
	  save(new PromoterLog(promoterId, MyUtil.c(), content, contentEn));
  }
  
  public void save_4(int promoterId, String timeStamp, String content, String contentEn)
  {
	  save(new PromoterLog(promoterId, timeStamp, content, contentEn));
  }
  
  public void evict(Object obj)
  {
    getSession().evict(obj);
  }
}

